<!--
 * @Author: Dagon
 * @Date: 2021-03-06 19:21:45
 * @Description: inline-block 节点之间出现间隔问题--- 原因HTML代码中的回车换行被转成一个空白字符串，在字体不为0的情况下，
                 空白符占据一定宽度，所以inline-block元素之间就出现了空隙。这些元素之间的间距会随着字体的大小而变化，当行内
                 元素font-size:1px时，间距为8px              
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <style>
    .box1 {
      font-size: 0;
      display: inline-block;
    }

    span {
      font-size: 16px;
    }
  </style>
  <title>Document</title>
</head>

<body>
  <!-- 父级font-size: 0,子级设置所需字体大小 -->
  <div class="box1">
    <span>1</span>
    <span>2</span>
    <span>3</span>
  </div>
  <!-- 改变书写方式换成一行 -->
  <div class="box2">
    <span>1</span><span>2</span><span>3</span>
  </div>
  <!-- margin 设置为负值 -->
  <div class="box3">
    <span>1</span>
    <span>2</span>
    <span>3</span>
  </div>
  <!-- 设置父元素display: table; word-spacing: 0 -->
  <div class="box4">
    <span>1</span>
    <span>2</span>
    <span>3</span>
  </div>
</body>

</html>